<?
	include("API.php");
	session_start();
?>
<html>
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<TABLE cellpadding="5" align = "right" >
<TR>
	<TD valign="center" style="font-family:verdana;font-size:140%" colspan = "2" width = "140%">
		<?php 
			if (isset($_GET["l"]))
			{
				if ($_GET["l"] == "public")
				{
					echo 'Public Notes';
					$list=0;
				}
				elseif ($_GET["l"] == "mine")
				{
					echo 'My Notes';
					$list=1;
				}
			}
			else 
			{
				echo 'Public Notes';
				$list=0;
			}
				
		?>
	</TD>
</TR>
<?php
	if ($list == 0)
	{
		$num = getAllPublicNoteNumber($client,"NULL");
		$result = getAllPublicNoteList($client,"NULL",0,$num,($NOTE_TITLE | $NOTE_CREATE_TIME ));

		foreach ($result as $value)
		{
			//$array = get_object_vars ($value);
			echo '<TR>';
			echo '<TD valign="center" style="font-family:verdana;font-size:140%" >&nbsp;</TD>';
			echo '<TD width = "70%"><A href="note.php?no='.$value->id.'" target = "note">Title:'.$value->title.'</BR>Date:'.$value->create_time.'</A></TD></TR>';
		}
	}
	elseif ($list == 1)
	{
		$num = getMyNoteNumber($client,$_SESSION["sessionid"]);
		$result = getMyNoteList($client,$_SESSION["sessionid"],0,$num,($NOTE_TITLE | $NOTE_CREATE_TIME ));

		foreach ($result as $value)
		{
			//$array = get_object_vars ($value);
			echo '<TR>';
			echo '<TD valign="center" style="font-family:verdana;font-size:140%" >&nbsp;</TD>';
			echo '<TD width = "70%"><A href="note.php?no='.$value->id.'" target = "note">Title:'.$value->title.'</BR>Date:'.$value->create_time.'</A></TD></TR>';
		}
	}
?>
</TABLE>


</body>
</html
